import {BasicApi} from "@/common/BasicApi.ts";
import {SetMeal} from "@/dto/Main/SetMeal.ts";
import Result from "@/common/Result.ts";
import PageVo from "@/common/PageVo.ts";
import SelectVo from "@/common/SelectVo.ts";
import axiosRequest from "@/config/axios.ts";

export class SetMealApi implements BasicApi<SetMeal, SetMeal, SetMeal>{
    async deleted(sb: SetMeal): Promise<Result<SetMeal>> {
        return await axiosRequest.post("/main/set_meal/deleted",sb);
    }

    async deletedAll(sbList: Array<SetMeal>): Promise<Result<Array<SetMeal>>> {
        return await axiosRequest.post("/main/set_meal/deleted_all",sbList);
    }

    async edit(b: SetMeal): Promise<Result<SetMeal>> {
        return await axiosRequest.post("/main/set_meal/edit",b);
    }

    async editAll(bList: Array<SetMeal>): Promise<Result<Array<SetMeal>>> {
        return await axiosRequest.post("/main/set_meal/edit_all",bList);
    }

    async get(sb: SetMeal): Promise<Result<SetMeal>> {
        return await axiosRequest.post("/main/set_meal/get",sb);
    }

    async listAll(sb: SetMeal): Promise<Result<Array<SetMeal>>> {
        return await axiosRequest.post("/main/set_meal/list_all",sb);
    }

    async option(): Promise<Result<Array<SelectVo<string, number, SetMeal>>>> {
        return await axiosRequest.post("/main/set_meal/option");
    }

    async pageAll(sb: SetMeal): Promise<Result<PageVo<SetMeal>>> {
        return await axiosRequest.post("/main/set_meal/page_all",sb);
    }

}